<template>
  <div>
    <el-card>   <el-button @click="sendMsg()">socket测试</el-button> </el-card>
  </div>
</template>

<script>
export default {
  name: "socket",
  data() {
    return {};
  },
  created() {
    this.$store.dispatch("socket/createWebSocket");
  },
  methods: {
    sendMsg() {
      const obj = {
        name: "测试数据",
        type: 0,
      };
      this.$store.dispatch("socket/sendSock", obj);
    },
  },
};
</script>

<style scoped></style>
